package com.yanqu.road.server.pb;

import com.yanqu.road.entity.activity.musicroomrank.CrossMusicRoomRankShowData;
import com.yanqu.road.entity.activity.musicroomrank.UserMusicRoomRankBeautyData;
import com.yanqu.road.entity.musicroom.MusicRoomFurnitureInfo;
import com.yanqu.road.entity.musicroom.UserMusicRoomBeautyData;
import com.yanqu.road.entity.musicroom.UserMusicRoomBuildingData;
import com.yanqu.road.entity.player.UserBaseInfo;
import com.yanqu.road.logic.pb.PlayerBasePb;
import com.yanqu.road.pb.activity.MusicRoomProto;
import com.yanqu.road.pb.activity.MusicRoomRankProto;
import com.yanqu.road.server.manger.config.MusicRoomConfigMgr;
import com.yanqu.road.utils.property.PropertyHelper;

import java.util.List;

public class MusicRoomRankPb {
    public static MusicRoomRankProto.MusicRoomRankBeautyTemp.Builder parseBeautyTemp(UserMusicRoomRankBeautyData beautyData) {
        MusicRoomRankProto.MusicRoomRankBeautyTemp.Builder builder = MusicRoomRankProto.MusicRoomRankBeautyTemp.newBuilder();
        builder.setBeautyId(beautyData.getBeautyId());
        builder.setSkinId(beautyData.getSkinId());
        builder.setFreeTimes(beautyData.getFreeTimes());
        builder.setItemTimes(beautyData.getItemTimes());
        builder.setJoinRound(beautyData.getJoinRound());

        return builder;
    }

    public static MusicRoomRankProto.MusicRoomRankShowTemp.Builder parseBeautyShowTemp(CrossMusicRoomRankShowData beautyShowData, UserBaseInfo userBaseInfo, boolean isRank) {
        MusicRoomRankProto.MusicRoomRankShowTemp.Builder builder = MusicRoomRankProto.MusicRoomRankShowTemp.newBuilder();
        builder.setBeautyId(beautyShowData.getBeautyId());
        builder.setSkinId(beautyShowData.getSkinId());
        builder.setScore(beautyShowData.getShowScore());
        builder.setUserBaseInfo(PlayerBasePb.parsePlayerBaseTempMsg(userBaseInfo));
        if (isRank) {
            builder.setIndex(beautyShowData.getRank());
        } else {
            builder.setIndex(beautyShowData.getJoinPos());
        }
        return builder;
    }
}
